import 'package:winkai/generated/json/base/json_convert_content.dart';
import 'package:winkai/helper/iap/entity/a_iap_rsp.dart';

AIAPRsp $AIAPRspFromJson(Map<String, dynamic> json) {
  final AIAPRsp aIAPRsp = AIAPRsp();
  final AIAPRspEntity? entity = jsonConvert.convert<AIAPRspEntity>(
      json['entity']);
  if (entity != null) {
    aIAPRsp.entity = entity;
  }
  final List<dynamic>? checks = (json['checks'] as List<dynamic>?)?.map(
          (e) => e).toList();
  if (checks != null) {
    aIAPRsp.checks = checks;
  }
  return aIAPRsp;
}

Map<String, dynamic> $AIAPRspToJson(AIAPRsp entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['entity'] = entity.entity?.toJson();
  data['checks'] = entity.checks;
  return data;
}

extension AIAPRspExtension on AIAPRsp {
  AIAPRsp copyWith({
    AIAPRspEntity? entity,
    List<dynamic>? checks,
  }) {
    return AIAPRsp()
      ..entity = entity ?? this.entity
      ..checks = checks ?? this.checks;
  }
}

AIAPRspEntity $AIAPRspEntityFromJson(Map<String, dynamic> json) {
  final AIAPRspEntity aIAPRspEntity = AIAPRspEntity();
  final String? environment = jsonConvert.convert<String>(json['environment']);
  if (environment != null) {
    aIAPRspEntity.environment = environment;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    aIAPRspEntity.status = status;
  }
  final AIAPRspEntityReceipt? receipt = jsonConvert.convert<
      AIAPRspEntityReceipt>(json['receipt']);
  if (receipt != null) {
    aIAPRspEntity.receipt = receipt;
  }
  final List<
      AIAPRspEntityLatestReceiptInfo>? latestReceiptInfo = (json['latest_receipt_info'] as List<
      dynamic>?)?.map(
          (e) =>
      jsonConvert.convert<AIAPRspEntityLatestReceiptInfo>(
          e) as AIAPRspEntityLatestReceiptInfo).toList();
  if (latestReceiptInfo != null) {
    aIAPRspEntity.latestReceiptInfo = latestReceiptInfo;
  }
  final List<
      AIAPRspEntityPendingRenewalInfo>? pendingRenewalInfo = (json['pending_renewal_info'] as List<
      dynamic>?)?.map(
          (e) =>
      jsonConvert.convert<AIAPRspEntityPendingRenewalInfo>(
          e) as AIAPRspEntityPendingRenewalInfo).toList();
  if (pendingRenewalInfo != null) {
    aIAPRspEntity.pendingRenewalInfo = pendingRenewalInfo;
  }
  final bool? ok = jsonConvert.convert<bool>(json['ok']);
  if (ok != null) {
    aIAPRspEntity.ok = ok;
  }
  final String? deviceId = jsonConvert.convert<String>(json['device_id']);
  if (deviceId != null) {
    aIAPRspEntity.deviceId = deviceId;
  }
  return aIAPRspEntity;
}

Map<String, dynamic> $AIAPRspEntityToJson(AIAPRspEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['environment'] = entity.environment;
  data['status'] = entity.status;
  data['receipt'] = entity.receipt?.toJson();
  data['latest_receipt_info'] =
      entity.latestReceiptInfo?.map((v) => v.toJson()).toList();
  data['pending_renewal_info'] =
      entity.pendingRenewalInfo?.map((v) => v.toJson()).toList();
  data['ok'] = entity.ok;
  data['device_id'] = entity.deviceId;
  return data;
}

extension AIAPRspEntityExtension on AIAPRspEntity {
  AIAPRspEntity copyWith({
    String? environment,
    int? status,
    AIAPRspEntityReceipt? receipt,
    List<AIAPRspEntityLatestReceiptInfo>? latestReceiptInfo,
    List<AIAPRspEntityPendingRenewalInfo>? pendingRenewalInfo,
    bool? ok,
    String? deviceId,
  }) {
    return AIAPRspEntity()
      ..environment = environment ?? this.environment
      ..status = status ?? this.status
      ..receipt = receipt ?? this.receipt
      ..latestReceiptInfo = latestReceiptInfo ?? this.latestReceiptInfo
      ..pendingRenewalInfo = pendingRenewalInfo ?? this.pendingRenewalInfo
      ..ok = ok ?? this.ok
      ..deviceId = deviceId ?? this.deviceId;
  }
}

AIAPRspEntityReceipt $AIAPRspEntityReceiptFromJson(Map<String, dynamic> json) {
  final AIAPRspEntityReceipt aIAPRspEntityReceipt = AIAPRspEntityReceipt();
  final String? receiptType = jsonConvert.convert<String>(json['receipt_type']);
  if (receiptType != null) {
    aIAPRspEntityReceipt.receiptType = receiptType;
  }
  final int? adamId = jsonConvert.convert<int>(json['adam_id']);
  if (adamId != null) {
    aIAPRspEntityReceipt.adamId = adamId;
  }
  final int? appItemId = jsonConvert.convert<int>(json['app_item_id']);
  if (appItemId != null) {
    aIAPRspEntityReceipt.appItemId = appItemId;
  }
  final String? bundleId = jsonConvert.convert<String>(json['bundle_id']);
  if (bundleId != null) {
    aIAPRspEntityReceipt.bundleId = bundleId;
  }
  final String? applicationVersion = jsonConvert.convert<String>(
      json['application_version']);
  if (applicationVersion != null) {
    aIAPRspEntityReceipt.applicationVersion = applicationVersion;
  }
  final int? downloadId = jsonConvert.convert<int>(json['download_id']);
  if (downloadId != null) {
    aIAPRspEntityReceipt.downloadId = downloadId;
  }
  final int? versionExternalIdentifier = jsonConvert.convert<int>(
      json['version_external_identifier']);
  if (versionExternalIdentifier != null) {
    aIAPRspEntityReceipt.versionExternalIdentifier = versionExternalIdentifier;
  }
  final String? receiptCreationDate = jsonConvert.convert<String>(
      json['receipt_creation_date']);
  if (receiptCreationDate != null) {
    aIAPRspEntityReceipt.receiptCreationDate = receiptCreationDate;
  }
  final int? receiptCreationDateMs = jsonConvert.convert<int>(
      json['receipt_creation_date_ms']);
  if (receiptCreationDateMs != null) {
    aIAPRspEntityReceipt.receiptCreationDateMs = receiptCreationDateMs;
  }
  final String? receiptCreationDatePst = jsonConvert.convert<String>(
      json['receipt_creation_date_pst']);
  if (receiptCreationDatePst != null) {
    aIAPRspEntityReceipt.receiptCreationDatePst = receiptCreationDatePst;
  }
  final String? requestDate = jsonConvert.convert<String>(json['request_date']);
  if (requestDate != null) {
    aIAPRspEntityReceipt.requestDate = requestDate;
  }
  final int? requestDateMs = jsonConvert.convert<int>(json['request_date_ms']);
  if (requestDateMs != null) {
    aIAPRspEntityReceipt.requestDateMs = requestDateMs;
  }
  final String? requestDatePst = jsonConvert.convert<String>(
      json['request_date_pst']);
  if (requestDatePst != null) {
    aIAPRspEntityReceipt.requestDatePst = requestDatePst;
  }
  final int? originalPurchaseDateMs = jsonConvert.convert<int>(
      json['original_purchase_date_ms']);
  if (originalPurchaseDateMs != null) {
    aIAPRspEntityReceipt.originalPurchaseDateMs = originalPurchaseDateMs;
  }
  final String? originalPurchaseDate = jsonConvert.convert<String>(
      json['original_purchase_date']);
  if (originalPurchaseDate != null) {
    aIAPRspEntityReceipt.originalPurchaseDate = originalPurchaseDate;
  }
  final String? originalPurchaseDatePst = jsonConvert.convert<String>(
      json['original_purchase_date_pst']);
  if (originalPurchaseDatePst != null) {
    aIAPRspEntityReceipt.originalPurchaseDatePst = originalPurchaseDatePst;
  }
  final String? originalApplicationVersion = jsonConvert.convert<String>(
      json['original_application_version']);
  if (originalApplicationVersion != null) {
    aIAPRspEntityReceipt.originalApplicationVersion =
        originalApplicationVersion;
  }
  final List<AIAPRspEntityReceiptInApp>? inApp = (json['in_app'] as List<
      dynamic>?)?.map(
          (e) =>
      jsonConvert.convert<AIAPRspEntityReceiptInApp>(
          e) as AIAPRspEntityReceiptInApp).toList();
  if (inApp != null) {
    aIAPRspEntityReceipt.inApp = inApp;
  }
  return aIAPRspEntityReceipt;
}

Map<String, dynamic> $AIAPRspEntityReceiptToJson(AIAPRspEntityReceipt entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['receipt_type'] = entity.receiptType;
  data['adam_id'] = entity.adamId;
  data['app_item_id'] = entity.appItemId;
  data['bundle_id'] = entity.bundleId;
  data['application_version'] = entity.applicationVersion;
  data['download_id'] = entity.downloadId;
  data['version_external_identifier'] = entity.versionExternalIdentifier;
  data['receipt_creation_date'] = entity.receiptCreationDate;
  data['receipt_creation_date_ms'] = entity.receiptCreationDateMs;
  data['receipt_creation_date_pst'] = entity.receiptCreationDatePst;
  data['request_date'] = entity.requestDate;
  data['request_date_ms'] = entity.requestDateMs;
  data['request_date_pst'] = entity.requestDatePst;
  data['original_purchase_date_ms'] = entity.originalPurchaseDateMs;
  data['original_purchase_date'] = entity.originalPurchaseDate;
  data['original_purchase_date_pst'] = entity.originalPurchaseDatePst;
  data['original_application_version'] = entity.originalApplicationVersion;
  data['in_app'] = entity.inApp?.map((v) => v.toJson()).toList();
  return data;
}

extension AIAPRspEntityReceiptExtension on AIAPRspEntityReceipt {
  AIAPRspEntityReceipt copyWith({
    String? receiptType,
    int? adamId,
    int? appItemId,
    String? bundleId,
    String? applicationVersion,
    int? downloadId,
    int? versionExternalIdentifier,
    String? receiptCreationDate,
    int? receiptCreationDateMs,
    String? receiptCreationDatePst,
    String? requestDate,
    int? requestDateMs,
    String? requestDatePst,
    int? originalPurchaseDateMs,
    String? originalPurchaseDate,
    String? originalPurchaseDatePst,
    String? originalApplicationVersion,
    List<AIAPRspEntityReceiptInApp>? inApp,
  }) {
    return AIAPRspEntityReceipt()
      ..receiptType = receiptType ?? this.receiptType
      ..adamId = adamId ?? this.adamId
      ..appItemId = appItemId ?? this.appItemId
      ..bundleId = bundleId ?? this.bundleId
      ..applicationVersion = applicationVersion ?? this.applicationVersion
      ..downloadId = downloadId ?? this.downloadId
      ..versionExternalIdentifier = versionExternalIdentifier ??
          this.versionExternalIdentifier
      ..receiptCreationDate = receiptCreationDate ?? this.receiptCreationDate
      ..receiptCreationDateMs = receiptCreationDateMs ??
          this.receiptCreationDateMs
      ..receiptCreationDatePst = receiptCreationDatePst ??
          this.receiptCreationDatePst
      ..requestDate = requestDate ?? this.requestDate
      ..requestDateMs = requestDateMs ?? this.requestDateMs
      ..requestDatePst = requestDatePst ?? this.requestDatePst
      ..originalPurchaseDateMs = originalPurchaseDateMs ??
          this.originalPurchaseDateMs
      ..originalPurchaseDate = originalPurchaseDate ?? this.originalPurchaseDate
      ..originalPurchaseDatePst = originalPurchaseDatePst ??
          this.originalPurchaseDatePst
      ..originalApplicationVersion = originalApplicationVersion ??
          this.originalApplicationVersion
      ..inApp = inApp ?? this.inApp;
  }
}

AIAPRspEntityReceiptInApp $AIAPRspEntityReceiptInAppFromJson(
    Map<String, dynamic> json) {
  final AIAPRspEntityReceiptInApp aIAPRspEntityReceiptInApp = AIAPRspEntityReceiptInApp();
  final int? expiresDateMs = jsonConvert.convert<int>(json['expires_date_ms']);
  if (expiresDateMs != null) {
    aIAPRspEntityReceiptInApp.expiresDateMs = expiresDateMs;
  }
  final String? expiresDate = jsonConvert.convert<String>(json['expires_date']);
  if (expiresDate != null) {
    aIAPRspEntityReceiptInApp.expiresDate = expiresDate;
  }
  final String? expiresDatePst = jsonConvert.convert<String>(
      json['expires_date_pst']);
  if (expiresDatePst != null) {
    aIAPRspEntityReceiptInApp.expiresDatePst = expiresDatePst;
  }
  final int? originalPurchaseDateMs = jsonConvert.convert<int>(
      json['original_purchase_date_ms']);
  if (originalPurchaseDateMs != null) {
    aIAPRspEntityReceiptInApp.originalPurchaseDateMs = originalPurchaseDateMs;
  }
  final String? originalPurchaseDate = jsonConvert.convert<String>(
      json['original_purchase_date']);
  if (originalPurchaseDate != null) {
    aIAPRspEntityReceiptInApp.originalPurchaseDate = originalPurchaseDate;
  }
  final String? originalPurchaseDatePst = jsonConvert.convert<String>(
      json['original_purchase_date_pst']);
  if (originalPurchaseDatePst != null) {
    aIAPRspEntityReceiptInApp.originalPurchaseDatePst = originalPurchaseDatePst;
  }
  final bool? isTrialPeriod = jsonConvert.convert<bool>(
      json['is_trial_period']);
  if (isTrialPeriod != null) {
    aIAPRspEntityReceiptInApp.isTrialPeriod = isTrialPeriod;
  }
  final bool? isInIntroOfferPeriod = jsonConvert.convert<bool>(
      json['is_in_intro_offer_period']);
  if (isInIntroOfferPeriod != null) {
    aIAPRspEntityReceiptInApp.isInIntroOfferPeriod = isInIntroOfferPeriod;
  }
  final int? purchaseDateMs = jsonConvert.convert<int>(
      json['purchase_date_ms']);
  if (purchaseDateMs != null) {
    aIAPRspEntityReceiptInApp.purchaseDateMs = purchaseDateMs;
  }
  final String? purchaseDate = jsonConvert.convert<String>(
      json['purchase_date']);
  if (purchaseDate != null) {
    aIAPRspEntityReceiptInApp.purchaseDate = purchaseDate;
  }
  final String? purchaseDatePst = jsonConvert.convert<String>(
      json['purchase_date_pst']);
  if (purchaseDatePst != null) {
    aIAPRspEntityReceiptInApp.purchaseDatePst = purchaseDatePst;
  }
  final String? productId = jsonConvert.convert<String>(json['product_id']);
  if (productId != null) {
    aIAPRspEntityReceiptInApp.productId = productId;
  }
  final String? transactionId = jsonConvert.convert<String>(
      json['transaction_id']);
  if (transactionId != null) {
    aIAPRspEntityReceiptInApp.transactionId = transactionId;
  }
  final String? originalTransactionId = jsonConvert.convert<String>(
      json['original_transaction_id']);
  if (originalTransactionId != null) {
    aIAPRspEntityReceiptInApp.originalTransactionId = originalTransactionId;
  }
  final String? quantity = jsonConvert.convert<String>(json['quantity']);
  if (quantity != null) {
    aIAPRspEntityReceiptInApp.quantity = quantity;
  }
  final String? webOrderLineItemId = jsonConvert.convert<String>(
      json['web_order_line_item_id']);
  if (webOrderLineItemId != null) {
    aIAPRspEntityReceiptInApp.webOrderLineItemId = webOrderLineItemId;
  }
  return aIAPRspEntityReceiptInApp;
}

Map<String, dynamic> $AIAPRspEntityReceiptInAppToJson(
    AIAPRspEntityReceiptInApp entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['expires_date_ms'] = entity.expiresDateMs;
  data['expires_date'] = entity.expiresDate;
  data['expires_date_pst'] = entity.expiresDatePst;
  data['original_purchase_date_ms'] = entity.originalPurchaseDateMs;
  data['original_purchase_date'] = entity.originalPurchaseDate;
  data['original_purchase_date_pst'] = entity.originalPurchaseDatePst;
  data['is_trial_period'] = entity.isTrialPeriod;
  data['is_in_intro_offer_period'] = entity.isInIntroOfferPeriod;
  data['purchase_date_ms'] = entity.purchaseDateMs;
  data['purchase_date'] = entity.purchaseDate;
  data['purchase_date_pst'] = entity.purchaseDatePst;
  data['product_id'] = entity.productId;
  data['transaction_id'] = entity.transactionId;
  data['original_transaction_id'] = entity.originalTransactionId;
  data['quantity'] = entity.quantity;
  data['web_order_line_item_id'] = entity.webOrderLineItemId;
  return data;
}

extension AIAPRspEntityReceiptInAppExtension on AIAPRspEntityReceiptInApp {
  AIAPRspEntityReceiptInApp copyWith({
    int? expiresDateMs,
    String? expiresDate,
    String? expiresDatePst,
    int? originalPurchaseDateMs,
    String? originalPurchaseDate,
    String? originalPurchaseDatePst,
    bool? isTrialPeriod,
    bool? isInIntroOfferPeriod,
    int? purchaseDateMs,
    String? purchaseDate,
    String? purchaseDatePst,
    String? productId,
    String? transactionId,
    String? originalTransactionId,
    String? quantity,
    String? webOrderLineItemId,
  }) {
    return AIAPRspEntityReceiptInApp()
      ..expiresDateMs = expiresDateMs ?? this.expiresDateMs
      ..expiresDate = expiresDate ?? this.expiresDate
      ..expiresDatePst = expiresDatePst ?? this.expiresDatePst
      ..originalPurchaseDateMs = originalPurchaseDateMs ??
          this.originalPurchaseDateMs
      ..originalPurchaseDate = originalPurchaseDate ?? this.originalPurchaseDate
      ..originalPurchaseDatePst = originalPurchaseDatePst ??
          this.originalPurchaseDatePst
      ..isTrialPeriod = isTrialPeriod ?? this.isTrialPeriod
      ..isInIntroOfferPeriod = isInIntroOfferPeriod ?? this.isInIntroOfferPeriod
      ..purchaseDateMs = purchaseDateMs ?? this.purchaseDateMs
      ..purchaseDate = purchaseDate ?? this.purchaseDate
      ..purchaseDatePst = purchaseDatePst ?? this.purchaseDatePst
      ..productId = productId ?? this.productId
      ..transactionId = transactionId ?? this.transactionId
      ..originalTransactionId = originalTransactionId ??
          this.originalTransactionId
      ..quantity = quantity ?? this.quantity
      ..webOrderLineItemId = webOrderLineItemId ?? this.webOrderLineItemId;
  }
}

AIAPRspEntityLatestReceiptInfo $AIAPRspEntityLatestReceiptInfoFromJson(
    Map<String, dynamic> json) {
  final AIAPRspEntityLatestReceiptInfo aIAPRspEntityLatestReceiptInfo = AIAPRspEntityLatestReceiptInfo();
  final String? quantity = jsonConvert.convert<String>(json['quantity']);
  if (quantity != null) {
    aIAPRspEntityLatestReceiptInfo.quantity = quantity;
  }
  final String? productId = jsonConvert.convert<String>(json['product_id']);
  if (productId != null) {
    aIAPRspEntityLatestReceiptInfo.productId = productId;
  }
  final String? transactionId = jsonConvert.convert<String>(
      json['transaction_id']);
  if (transactionId != null) {
    aIAPRspEntityLatestReceiptInfo.transactionId = transactionId;
  }
  final String? originalTransactionId = jsonConvert.convert<String>(
      json['original_transaction_id']);
  if (originalTransactionId != null) {
    aIAPRspEntityLatestReceiptInfo.originalTransactionId =
        originalTransactionId;
  }
  final String? webOrderLineItemId = jsonConvert.convert<String>(
      json['web_order_line_item_id']);
  if (webOrderLineItemId != null) {
    aIAPRspEntityLatestReceiptInfo.webOrderLineItemId = webOrderLineItemId;
  }
  final String? subscriptionGroupIdentifier = jsonConvert.convert<String>(
      json['subscription_group_identifier']);
  if (subscriptionGroupIdentifier != null) {
    aIAPRspEntityLatestReceiptInfo.subscriptionGroupIdentifier =
        subscriptionGroupIdentifier;
  }
  final String? isTrialPeriod = jsonConvert.convert<String>(
      json['is_trial_period']);
  if (isTrialPeriod != null) {
    aIAPRspEntityLatestReceiptInfo.isTrialPeriod = isTrialPeriod;
  }
  final String? isInIntroOfferPeriod = jsonConvert.convert<String>(
      json['is_in_intro_offer_period']);
  if (isInIntroOfferPeriod != null) {
    aIAPRspEntityLatestReceiptInfo.isInIntroOfferPeriod = isInIntroOfferPeriod;
  }
  final String? inAppOwnershipType = jsonConvert.convert<String>(
      json['in_app_ownership_type']);
  if (inAppOwnershipType != null) {
    aIAPRspEntityLatestReceiptInfo.inAppOwnershipType = inAppOwnershipType;
  }
  final int? purchaseDateMs = jsonConvert.convert<int>(
      json['purchase_date_ms']);
  if (purchaseDateMs != null) {
    aIAPRspEntityLatestReceiptInfo.purchaseDateMs = purchaseDateMs;
  }
  final String? purchaseDate = jsonConvert.convert<String>(
      json['purchase_date']);
  if (purchaseDate != null) {
    aIAPRspEntityLatestReceiptInfo.purchaseDate = purchaseDate;
  }
  final String? purchaseDatePst = jsonConvert.convert<String>(
      json['purchase_date_pst']);
  if (purchaseDatePst != null) {
    aIAPRspEntityLatestReceiptInfo.purchaseDatePst = purchaseDatePst;
  }
  final int? originalPurchaseDateMs = jsonConvert.convert<int>(
      json['original_purchase_date_ms']);
  if (originalPurchaseDateMs != null) {
    aIAPRspEntityLatestReceiptInfo.originalPurchaseDateMs =
        originalPurchaseDateMs;
  }
  final String? originalPurchaseDate = jsonConvert.convert<String>(
      json['original_purchase_date']);
  if (originalPurchaseDate != null) {
    aIAPRspEntityLatestReceiptInfo.originalPurchaseDate = originalPurchaseDate;
  }
  final String? originalPurchaseDatePst = jsonConvert.convert<String>(
      json['original_purchase_date_pst']);
  if (originalPurchaseDatePst != null) {
    aIAPRspEntityLatestReceiptInfo.originalPurchaseDatePst =
        originalPurchaseDatePst;
  }
  final int? expiresDateMs = jsonConvert.convert<int>(json['expires_date_ms']);
  if (expiresDateMs != null) {
    aIAPRspEntityLatestReceiptInfo.expiresDateMs = expiresDateMs;
  }
  final String? expiresDate = jsonConvert.convert<String>(json['expires_date']);
  if (expiresDate != null) {
    aIAPRspEntityLatestReceiptInfo.expiresDate = expiresDate;
  }
  final String? expiresDatePst = jsonConvert.convert<String>(
      json['expires_date_pst']);
  if (expiresDatePst != null) {
    aIAPRspEntityLatestReceiptInfo.expiresDatePst = expiresDatePst;
  }
  return aIAPRspEntityLatestReceiptInfo;
}

Map<String, dynamic> $AIAPRspEntityLatestReceiptInfoToJson(
    AIAPRspEntityLatestReceiptInfo entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['quantity'] = entity.quantity;
  data['product_id'] = entity.productId;
  data['transaction_id'] = entity.transactionId;
  data['original_transaction_id'] = entity.originalTransactionId;
  data['web_order_line_item_id'] = entity.webOrderLineItemId;
  data['subscription_group_identifier'] = entity.subscriptionGroupIdentifier;
  data['is_trial_period'] = entity.isTrialPeriod;
  data['is_in_intro_offer_period'] = entity.isInIntroOfferPeriod;
  data['in_app_ownership_type'] = entity.inAppOwnershipType;
  data['purchase_date_ms'] = entity.purchaseDateMs;
  data['purchase_date'] = entity.purchaseDate;
  data['purchase_date_pst'] = entity.purchaseDatePst;
  data['original_purchase_date_ms'] = entity.originalPurchaseDateMs;
  data['original_purchase_date'] = entity.originalPurchaseDate;
  data['original_purchase_date_pst'] = entity.originalPurchaseDatePst;
  data['expires_date_ms'] = entity.expiresDateMs;
  data['expires_date'] = entity.expiresDate;
  data['expires_date_pst'] = entity.expiresDatePst;
  return data;
}

extension AIAPRspEntityLatestReceiptInfoExtension on AIAPRspEntityLatestReceiptInfo {
  AIAPRspEntityLatestReceiptInfo copyWith({
    String? quantity,
    String? productId,
    String? transactionId,
    String? originalTransactionId,
    String? webOrderLineItemId,
    String? subscriptionGroupIdentifier,
    String? isTrialPeriod,
    String? isInIntroOfferPeriod,
    String? inAppOwnershipType,
    int? purchaseDateMs,
    String? purchaseDate,
    String? purchaseDatePst,
    int? originalPurchaseDateMs,
    String? originalPurchaseDate,
    String? originalPurchaseDatePst,
    int? expiresDateMs,
    String? expiresDate,
    String? expiresDatePst,
  }) {
    return AIAPRspEntityLatestReceiptInfo()
      ..quantity = quantity ?? this.quantity
      ..productId = productId ?? this.productId
      ..transactionId = transactionId ?? this.transactionId
      ..originalTransactionId = originalTransactionId ??
          this.originalTransactionId
      ..webOrderLineItemId = webOrderLineItemId ?? this.webOrderLineItemId
      ..subscriptionGroupIdentifier = subscriptionGroupIdentifier ??
          this.subscriptionGroupIdentifier
      ..isTrialPeriod = isTrialPeriod ?? this.isTrialPeriod
      ..isInIntroOfferPeriod = isInIntroOfferPeriod ?? this.isInIntroOfferPeriod
      ..inAppOwnershipType = inAppOwnershipType ?? this.inAppOwnershipType
      ..purchaseDateMs = purchaseDateMs ?? this.purchaseDateMs
      ..purchaseDate = purchaseDate ?? this.purchaseDate
      ..purchaseDatePst = purchaseDatePst ?? this.purchaseDatePst
      ..originalPurchaseDateMs = originalPurchaseDateMs ??
          this.originalPurchaseDateMs
      ..originalPurchaseDate = originalPurchaseDate ?? this.originalPurchaseDate
      ..originalPurchaseDatePst = originalPurchaseDatePst ??
          this.originalPurchaseDatePst
      ..expiresDateMs = expiresDateMs ?? this.expiresDateMs
      ..expiresDate = expiresDate ?? this.expiresDate
      ..expiresDatePst = expiresDatePst ?? this.expiresDatePst;
  }
}

AIAPRspEntityPendingRenewalInfo $AIAPRspEntityPendingRenewalInfoFromJson(
    Map<String, dynamic> json) {
  final AIAPRspEntityPendingRenewalInfo aIAPRspEntityPendingRenewalInfo = AIAPRspEntityPendingRenewalInfo();
  final String? autoRenewStatus = jsonConvert.convert<String>(
      json['auto_renew_status']);
  if (autoRenewStatus != null) {
    aIAPRspEntityPendingRenewalInfo.autoRenewStatus = autoRenewStatus;
  }
  final String? originalTransactionId = jsonConvert.convert<String>(
      json['original_transaction_id']);
  if (originalTransactionId != null) {
    aIAPRspEntityPendingRenewalInfo.originalTransactionId =
        originalTransactionId;
  }
  return aIAPRspEntityPendingRenewalInfo;
}

Map<String, dynamic> $AIAPRspEntityPendingRenewalInfoToJson(
    AIAPRspEntityPendingRenewalInfo entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['auto_renew_status'] = entity.autoRenewStatus;
  data['original_transaction_id'] = entity.originalTransactionId;
  return data;
}

extension AIAPRspEntityPendingRenewalInfoExtension on AIAPRspEntityPendingRenewalInfo {
  AIAPRspEntityPendingRenewalInfo copyWith({
    String? autoRenewStatus,
    String? originalTransactionId,
  }) {
    return AIAPRspEntityPendingRenewalInfo()
      ..autoRenewStatus = autoRenewStatus ?? this.autoRenewStatus
      ..originalTransactionId = originalTransactionId ??
          this.originalTransactionId;
  }
}